package com.example.superyi.myteam.roomPro.repositoryPro;

import android.content.Context;

import androidx.lifecycle.LiveData;

import com.example.superyi.myteam.roomPro.dao.AuthorEntityDao;
import com.example.superyi.myteam.roomPro.databasePro.MyDataBasePro;
import com.example.superyi.myteam.roomPro.entityPro.AuthorEntity;

import java.util.List;

public class AuthorEntityRepository {
    private AuthorEntityDao authorEntityDao;

    public AuthorEntityRepository(Context context){
        MyDataBasePro myDataBasePro=MyDataBasePro.getInstance(context.getApplicationContext());
        authorEntityDao=myDataBasePro.getAuthorEntityDao();
    }

    public LiveData<List<AuthorEntity>> getAuthorEntityById(String id){
        return authorEntityDao.getOwnAllPro(id);
    }
}
